package com.dementors.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.dementors.R;

/**
 * Created by Administrator on 2015/12/5 0005.
 */
public class MyTextView extends FrameLayout {
    private Context context;
    private TextView tv1;
    private TextView tv2;

    public MyTextView(Context context) {
        this(context, null);
    }

    public MyTextView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public MyTextView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.context = context;
        LayoutInflater.from(context).inflate(R.layout.mytv, this, true);
        initViews();//初始化控件
    }

    private void initViews() {
        tv1 = (TextView) findViewById(R.id.tv_mytv1);
        tv2 = (TextView) findViewById(R.id.tv_mytv2);
    }

    public void setText1(String text){
        tv1.setText(text);
    }

    public void setText2(String text){
        tv2.setText(text);
    }
}
